load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "rust_conch_parser",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {
        "cargo_target_config": {
            "crate_type": [
                "cdylib",
            ],
            "name": "conch_parser",
        },
        "cargo_toml_config": {
            "dependencies_override": {
                "dependencies": {
                    "cpython": {
                        "features": [
                            "serde-convert",
                            "python3-sys",
                            "extension-module",
                        ],
                        "git": None,
                        "rev": None,
                    },
                },
            },
        },
    },
    # The `ovr_config//os:<platform>` setting allows us to select which
    # platforms some target is compatible with. As this target is only a
    # dependency for the conch_parser target, let's disable it
    compatible_with = [
        "ovr_config//os:linux",
        "ovr_config//os:macos",
    ],
    crate = "conch_parser",
    crate_root = "src/lib.rs",
    link_style = "static",
    named_deps = {
        "third_party_conch_parser": "//eden/scm/lib/third-party/conch-parser:conch-parser",
    },
    deps = [
        "fbsource//third-party/rust:cpython",
    ],
)
